﻿@using Yyyg.Models;
@{
    ViewBag.Title = "ForType";
    Layout = "~/Views/Shared/_LayoutHome.cshtml";
    string[] parentTypes ={"手机数码","电脑办公","智能音影", "家用电器", "家居日用",
    "金银珠宝","箱包服饰","洗妆美护","酒水美食","汽车专区","虚拟卡券"};
    List<Yyyg.WebUI.Models.GoodItemVM> qlist = ViewBag.QList;//查询列表
    qlist = qlist.OrderBy(o => o.Rushinfo.Rem).ToList();
    Goods_type ptype = ViewBag.ParentType;//父级分类信息
    Goods_type stype = ViewBag.SubType;//子级分类信息
    List<Goods_type> stypes = ViewBag.SubTypes;//父级下所有子集信息
}
@section head{
    <link href="~/Content/home-fortype.css?@Tools.GetRandMax()" rel="stylesheet" />
    <script src="~/Scripts/src/home-fortype.js?v=2105111951"></script>
}
<div class="type-head">
    <div class="parent-types">
        <div class="top">
            <b>@ptype.Typename</b>
            <span class="blkfont">(共<span class="gdscount">@qlist.Count</span>件相关商品)</span>
        </div>
        <div class="btm-list">
            <ul>
                @for (int i = 1; i <= 11; i++)
                {
                    <li @(ptype.Typeid == i ? "class=sel" : "")>
                        <a href="/Home/ForType?t=@i">
                            <div class="typeico">
                                <i class="ico-first iconfont icon-gdtype-@i"></i>
                                <i class="ico-second iconfont icon-gdtype-@i"></i>
                            </div>
                            <p class="typename blkfont">@parentTypes[i - 1]</p>
                        </a>
                    </li>
                }
            </ul>
        </div>
    </div>
    <div class="sub-types glist">
        <span>分类:</span>
        <ul class="blkfont">
            @for (int i = 0; i < stypes.Count; i++)
            {
                var t = stypes[i];
                <li class="@(stype.Typeid == t.Typeid ? "sel" : "")"><a href="/Home/ForType?t=@t.Typeid"> @t.Typename</a></li>
            }
        </ul>
    </div>
    <div class="rank-types glist">
        <span>排序:</span>
        <ul class="blkfont">
            <li class="sel" id="rank-hot">人气商品</li>
            <li id="rank-new">最新商品</li>
            <li id="rank-rem-asc" class="iconfont icon-arrow-up-bold">剩余人次</li>
            <li id="rank-rem-desc" class="iconfont icon-arrow-down-bold ">剩余人次</li>
            <li id="rank-all-asc" class="iconfont icon-arrow-up-bold">总需人次</li>
            <li id="rank-all-desc" class="iconfont icon-arrow-down-bold">总需人次</li>
        </ul>
    </div>
</div>
<div class="gdlistview">
    <div class="gd-area">
        <div class="tbox">
            <h3 class="title">商品列表</h3>
            @*<a class="more" href="#"><span>更多商品,点击查看>></span> </a>*@
        </div>
        <div class="gd-list gd-list-c5">
            @for (int i = 0; i < qlist.Count(); i++)
            {
                var v = qlist[i];
            <div class="gd-item" data-rhid="@v.Rushinfo.Id" data-all="@v.Rushinfo.All_told" data-rem="@v.Rushinfo.Rem" data-time="@v.Rushinfo.Createtime.ToString("yyyyMMddHHmmssfff")">
                <a href="/Home/GoodAbout?rhid=@v.Rushinfo.Id"><img title="点击查看商品详情" class="gdimg" src="@v.MainUrl" /></a>
                <p class="blkfont gtitle"><a href="/Home/GoodAbout?rhid=@v.Rushinfo.Id">@v.Info.Title</a></p>
                <div class="bars">
                    <p class="minfont">总需：<span>@v.Info.Need_amo</span> 人次</p>
                    <div class="progbar">
                        <span style="width:@(v.Rushinfo.NowPercentage()+"%")" class="value"></span>
                    </div>
                    <div class="datas">
                        <div class="nums blkfont">
                            <span>@(v.Info.Need_amo-v.Rushinfo.Rem)</span>
                            <span>@v.Rushinfo.Rem</span>
                        </div>
                        <div class="txs">
                            <span>已参与人次</span>
                            <span>剩余人次</span>
                        </div>
                    </div>
                    <div></div>
                    <div></div>
                </div>
                <div class="btns">
                    <button title="立即一元云购" class="bynow">立即一元云购</button>
                    <button title="添加到购物车" class="addcar iconfont icon-tianjiadaogouwuche"></button>
                </div>
                <div data-gid="@v.Rushinfo.Goods.Gid" class="favorite" title="收藏/取消收藏">
                    <i class="layui-icon layui-icon-star"></i>
                </div>
            </div>
            }
        </div>
    </div>
</div>